#!/bin/sh

if [ `id -u` != '0' ] ; then
    echo "You must use sudo to run this command."
    exit 1
fi

mount -uw /

rm -rf /Library/Receipts/nitoTV.pkg/

installer -pkg nitoTV.pkg -target /

mount -ur /

echo "Restarting Finder..."

kill `ps awwx | grep [F]inder | awk '{print $1}'`

open /System/Library/CoreServices/Finder.app

exit 0